package edu.luc.cs.trull.translator;

import org.w3c.dom.Node;

/**
 * A visitor for an Trull XML document in the form of a DOM tree. 
 */
interface Visitor {

    /**
     * top level component
     */
    void triveni(Node node);

    //
    //triveni exprs
    //

    /**
     * ACT element
     */
    void act(Node node);

    /**
     * ASSERT element
     */
    void assertt(Node node);

    /**
     * ASSERTION element
     */
    void assertion(Node node);

    /**
     * AWAIT element
     */
    void await(Node node);

    /**
     * AWAITONE element
     */
    void awaitOne(Node node);

    /**
     * CONTROLLABLE element
     */
    void controllable(Node node);

    /**
     * CASE element
     */
    void cse(Node node);

    /**
     * DONE element
     */
    void done(Node node);

    /**
     * EMIT element
     */
    void emit(Node node);

    /**
     * EXPR element
     */
    void expr(Node node);

    /**
     * EXPRREF element
     */
    void exprRef(Node node);

    /**
     * EXPRSREF element
     */
    void exprsRef(Node node);

    /**
     * IF element
     */
    void iif(Node node);

    /**
     * LOCAL element
     */
    void local(Node node);

    /**
     * LOOP element
     */
    void loop(Node node);

    /**
     * NIL element
     */
    void nil(Node node);

    /**
     * PARALLEL element
     */
    void parallel(Node node);

    /**
     * RENAME element
     */
    void rename(Node node);

    /**
     * SEQUENCE element
     */
    void sequence(Node node);

    /**
     * SUSPENDRESUME
     */
    void suspendResume(Node node);

    /**
     * SWITCH element
     */
    void swtch(Node node);

    /**
     * WATCHING element
     */
    void watching(Node node);

    //
    //triveni activities
    //

    /**
     * ACTIVITY element
     */
    void activity(Node node);

    /**
     * ACTIVITYREF element
     */
    void activityRef(Node node);

    /**
     * THREADACTIVITY element
     */
    void threadActivity(Node node);

    void imprt(Node node);
    void declare(Node node);
    void code(Node node);
    void retrn(Node node);
    void timeOut(Node node);

    /**
     * EVENTLABEL element
     */
    void eventLabel(Node node);

    /**
     * EVENTLABELS element
     */
    void eventLabels(Node node);

    void param(Node node);
    void params(Node node);

    void signature(Node node);
    void signatures(Node node);

    /**
     * PREDICATE element
     */
    void predicate(Node node);

    /**
     * SATISFIED element
     */
    void satisfied(Node node);

    /**
     * VIOLATED element
     */
    void violated(Node node);

    /**
     * VALUATOR element
     */
    void valuator(Node node);

    /**
     * DEFAULT element
     */
    void defult(Node node);

    //
    //auxiliary elements to triveni activities
    //

    void updateHandler(Node node);
    void update(Node node);
    void onEmit(Node node);
    void onResume(Node node);
    void onStart(Node node);
    void onStop(Node node);
    void onSuspend(Node node);
    void run(Node node);

    //
    //triveni temporal exprs
    //

    void allPast(Node node);
    void and(Node node);
    void backTo(Node node);
    void implies(Node node);
    void leaf(Node node);
    void not(Node node);
    void once(Node node);
    void or(Node node);
    void previous(Node node);
    void since(Node node);

    void label(Node node);

    String TRIVENI = "triveni";
    String ACT = "act";
    String ASSERT = "assert";
    String AWAIT = "await";
    String AWAITONE = "awaitone";
    String CASE = "case";
    String CONTROLLABLE = "controllable";
    String DONE = "done";
    String EMIT = "emit";
    String EXPR = "expr";
    String EXPRREF = "exprref";
    String EXPRSREF = "exprsref";
    String IF = "if";
    String LOCAL = "local";
    String LOOP = "loop";
    String NIL = "nil";
    String PARALLEL = "parallel";
    String RENAME = "rename";
    String SEQUENCE = "sequence";
    String SUSPENDRESUME = "suspendresume";
    String SWITCH = "switch";
    String VALUATOR = "valuator";
    String WATCHING = "watching";

    String ACTIVITY = "activity";
    String ACTIVITYREF = "activityref";
    String ASSERTION = "assertion";
    String THREADACTIVITY = "threadactivity";

    String IMPORT = "import";
    String DECLARE = "declare";
    String CODE = "code";
    String RETURN = "return";
    String TIMEOUT = "timeout";
    String EVENTLABEL = "eventlabel";
    String EVENTLABELS = "eventlabels";
    String SIGNATURE = "signature";
    String PARAM = "param";
    String PARAMS = "params";
    String PREDICATE = "predicate";
    String SATISFIED = "satisfied";
    String VIOLATED = "violated";
    String DEFAULT = "default";
    String FROM = "from";
    String TO = "to";
    String SUSPEND = "suspend";
    String RESUME = "resume";
    String UPDATEHANDLER = "updatehandler";
    String UPDATE = "update";
    String ONEMIT = "onemit";
    String ONRESUME = "onresume";
    String ONSTART = "onstart";
    String ONSTOP = "onstop";
    String ONSUSPEND = "onsuspend";
    String RUN = "run";
    String TYPE = "type";

    String ALLPAST = "allpast";
    String AND = "and";
    String BACKTO = "backto";
    String IMPLIES = "implies";
    String LEAF = "leaf";
    String NOT = "not";
    String ONCE = "once";
    String OR = "or";
    String PREVIOUS = "previous";
    String SINCE = "since";

    String LABEL = "label";

    String NAME = "name";
    String ACCESS = "access";
    String EXTENDS = "extends";
    String IMPLEMENTS = "implements";
    String PACKAGE = "package";

    String DECLARABLES[] = new String[]{
        EXPR, CONTROLLABLE, ACTIVITY, THREADACTIVITY, EVENTLABELS
    };

    String EXPRS[] = new String[]{
        ACT, ASSERT, AWAIT, AWAITONE, CONTROLLABLE, DONE, EMIT,
        EXPRREF, IF, LOCAL, LOOP, NIL, PARALLEL, RENAME, SEQUENCE,
        SUSPENDRESUME, SWITCH, WATCHING
    };

    String ACTIVITIES[] = new String[]{
        ACTIVITY, ACTIVITYREF, ASSERTION, THREADACTIVITY
    };

    String TLEXPRS[] = new String[]{
        ALLPAST, AND, BACKTO, IMPLIES, LEAF,
        NOT, ONCE, OR, PREVIOUS, SINCE
    };

    String TLPARAMS[] = new String[]{
        ALLPAST, AND, BACKTO, IMPLIES, LEAF,
        NOT, ONCE, OR, PREVIOUS, SINCE, LABEL
    };

}





